.class Lrexsee/core/menu/PopMenu$1;
.super Ljava/lang/Object;
.source "PopMenu.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/core/menu/PopMenu;->open(Lrexsee/core/browser/Browser;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/core/menu/PopMenu;

.field private final synthetic val$browser:Lrexsee/core/browser/Browser;

.field private final synthetic val$context:Landroid/content/Context;

.field private final synthetic val$mThis:Lrexsee/core/menu/PopMenu;


# direct methods
.method constructor <init>(Lrexsee/core/menu/PopMenu;Landroid/content/Context;Lrexsee/core/browser/Browser;Lrexsee/core/menu/PopMenu;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    iput-object p2, p0, Lrexsee/core/menu/PopMenu$1;->val$context:Landroid/content/Context;

    iput-object p3, p0, Lrexsee/core/menu/PopMenu$1;->val$browser:Lrexsee/core/browser/Browser;

    iput-object p4, p0, Lrexsee/core/menu/PopMenu$1;->val$mThis:Lrexsee/core/menu/PopMenu;

    .line 69
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static synthetic access$0(Lrexsee/core/menu/PopMenu$1;)Lrexsee/core/menu/PopMenu;
    .locals 1

    .prologue
    .line 69
    iget-object v0, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    return-object v0
.end method


# virtual methods
.method public run()V
    .locals 15

    .prologue
    const/4 v12, 0x1

    const/4 v13, 0x0

    const-string v14, "true"

    .line 72
    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    iget-object v9, v9, Lrexsee/core/menu/PopMenu;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v9, v9, Lrexsee/core/style/StyleSheet;->window_type:Ljava/lang/String;

    const-string v10, "context"

    invoke-virtual {v9, v10}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v9

    if-eqz v9, :cond_2

    .line 73
    new-instance v9, Landroid/app/AlertDialog$Builder;

    iget-object v10, p0, Lrexsee/core/menu/PopMenu$1;->val$context:Landroid/content/Context;

    invoke-direct {v9, v10}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    invoke-virtual {v9}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v3

    .line 74
    .local v3, "dialog":Landroid/app/AlertDialog;
    invoke-virtual {v3, v12}, Landroid/app/AlertDialog;->setInverseBackgroundForced(Z)V

    .line 75
    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->val$browser:Lrexsee/core/browser/Browser;

    iget-object v9, v9, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v9, v9, Lrexsee/core/application/RexseeApplication;->icon:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v3, v9}, Landroid/app/AlertDialog;->setIcon(Landroid/graphics/drawable/Drawable;)V

    .line 76
    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    iget-object v9, v9, Lrexsee/core/menu/PopMenu;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v9, v9, Lrexsee/core/style/StyleSheet;->label:Ljava/lang/String;

    invoke-static {v9}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;

    move-result-object v9

    invoke-virtual {v3, v9}, Landroid/app/AlertDialog;->setTitle(Ljava/lang/CharSequence;)V

    .line 77
    const-string v2, "white-space:normal;font-size:18px;border-width:0 0 1 0;border-bottom-color:#888888+#FFFFFF/2;height:wrapcontent;color:#000000;icon-visibility:hidden;padding:15px;text-align:left;"

    .line 78
    .local v2, "contextStyle":Ljava/lang/String;
    new-instance v1, Lrexsee/core/widget/TabBar;

    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->val$context:Landroid/content/Context;

    iget-object v10, p0, Lrexsee/core/menu/PopMenu$1;->val$mThis:Lrexsee/core/menu/PopMenu;

    new-instance v11, Ljava/lang/StringBuilder;

    const-string v12, "orientation:vertical;background-color:#FFFFFF;border-width:0;overflow-y:visible;scrollbar-y:visible;"

    invoke-direct {v11, v12}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v12, p0, Lrexsee/core/menu/PopMenu$1;->val$mThis:Lrexsee/core/menu/PopMenu;

    iget-object v12, v12, Lrexsee/core/menu/PopMenu;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v12, v12, Lrexsee/core/style/StyleSheet;->styleText:Ljava/lang/String;

    invoke-virtual {v11, v12}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-direct {v1, v9, v10, v11}, Lrexsee/core/widget/TabBar;-><init>(Landroid/content/Context;Lrexsee/core/menu/PopMenu;Ljava/lang/String;)V

    .line 79
    .local v1, "bar":Lrexsee/core/widget/TabBar;
    const/16 v9, 0x140

    invoke-virtual {v1, v9}, Lrexsee/core/widget/TabBar;->setMinimumWidth(I)V

    .line 80
    const/4 v4, 0x0

    .local v4, "i":I
    :goto_0
    iget-object v9, v1, Lrexsee/core/widget/TabBar;->mContainer:Landroid/widget/LinearLayout;

    invoke-virtual {v9}, Landroid/widget/LinearLayout;->getChildCount()I

    move-result v9

    if-lt v4, v9, :cond_1

    .line 93
    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    iget-object v9, v9, Lrexsee/core/menu/PopMenu;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v9, v9, Lrexsee/core/style/StyleSheet;->window_cancelable:Ljava/lang/String;

    const-string v10, "true"

    invoke-virtual {v9, v14}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v9

    invoke-virtual {v3, v9}, Landroid/app/AlertDialog;->setCancelable(Z)V

    .line 94
    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    iget-object v9, v9, Lrexsee/core/menu/PopMenu;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v9, v9, Lrexsee/core/style/StyleSheet;->window_outside_cancelable:Ljava/lang/String;

    const-string v10, "true"

    invoke-virtual {v9, v14}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v9

    invoke-virtual {v3, v9}, Landroid/app/AlertDialog;->setCanceledOnTouchOutside(Z)V

    .line 95
    new-instance v9, Lrexsee/core/menu/PopMenu$1$2;

    invoke-direct {v9, p0}, Lrexsee/core/menu/PopMenu$1$2;-><init>(Lrexsee/core/menu/PopMenu$1;)V

    invoke-virtual {v3, v9}, Landroid/app/AlertDialog;->setOnKeyListener(Landroid/content/DialogInterface$OnKeyListener;)V

    .line 102
    new-instance v9, Lrexsee/core/menu/PopMenu$1$3;

    invoke-direct {v9, p0}, Lrexsee/core/menu/PopMenu$1$3;-><init>(Lrexsee/core/menu/PopMenu$1;)V

    invoke-virtual {v3, v9}, Landroid/app/AlertDialog;->setOnCancelListener(Landroid/content/DialogInterface$OnCancelListener;)V

    .line 111
    new-instance v9, Lrexsee/core/menu/PopMenu$1$4;

    invoke-direct {v9, p0}, Lrexsee/core/menu/PopMenu$1$4;-><init>(Lrexsee/core/menu/PopMenu$1;)V

    invoke-virtual {v3, v9}, Landroid/app/AlertDialog;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V

    .line 120
    invoke-virtual {v3, v1}, Landroid/app/AlertDialog;->setView(Landroid/view/View;)V

    .line 121
    invoke-virtual {v3}, Landroid/app/AlertDialog;->show()V

    .line 183
    .end local v2    # "contextStyle":Ljava/lang/String;
    .end local v3    # "dialog":Landroid/app/AlertDialog;
    :cond_0
    :goto_1
    return-void

    .line 81
    .restart local v2    # "contextStyle":Ljava/lang/String;
    .restart local v3    # "dialog":Landroid/app/AlertDialog;
    :cond_1
    iget-object v9, v1, Lrexsee/core/widget/TabBar;->mContainer:Landroid/widget/LinearLayout;

    invoke-virtual {v9, v4}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v7

    check-cast v7, Lrexsee/core/widget/Tab;

    .line 82
    .local v7, "tab":Lrexsee/core/widget/Tab;
    new-instance v9, Lrexsee/core/menu/PopMenu$1$1;

    invoke-direct {v9, p0, v3}, Lrexsee/core/menu/PopMenu$1$1;-><init>(Lrexsee/core/menu/PopMenu$1;Landroid/app/AlertDialog;)V

    iput-object v9, v7, Lrexsee/core/widget/Tab;->extraRunnable:Ljava/lang/Runnable;

    .line 88
    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    iget-object v9, v9, Lrexsee/core/menu/PopMenu;->items:Ljava/util/ArrayList;

    invoke-virtual {v9, v4}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lrexsee/core/menu/PopMenuItem;

    .line 89
    .local v5, "item":Lrexsee/core/menu/PopMenuItem;
    iget-object v9, v7, Lrexsee/core/widget/Tab;->styleNormal:Lrexsee/core/style/StyleSheet;

    new-instance v10, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    invoke-direct {v10, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v11, "background-color:#FFFFFF;"

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v9, v10}, Lrexsee/core/style/StyleSheet;->parseStyle(Ljava/lang/String;)Lrexsee/core/style/StyleSheet;

    move-result-object v9

    iget-object v10, v5, Lrexsee/core/menu/PopMenuItem;->styleNormal:Lrexsee/core/style/StyleSheet;

    iget-object v10, v10, Lrexsee/core/style/StyleSheet;->styleText:Ljava/lang/String;

    invoke-virtual {v9, v10}, Lrexsee/core/style/StyleSheet;->parseStyle(Ljava/lang/String;)Lrexsee/core/style/StyleSheet;

    .line 90
    iget-object v9, v7, Lrexsee/core/widget/Tab;->stylePressed:Lrexsee/core/style/StyleSheet;

    new-instance v10, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    invoke-direct {v10, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v11, "background-color:#DD8500+#FF9900+#FF9900+#FF9900+#DD8500;"

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v9, v10}, Lrexsee/core/style/StyleSheet;->parseStyle(Ljava/lang/String;)Lrexsee/core/style/StyleSheet;

    move-result-object v9

    iget-object v10, v5, Lrexsee/core/menu/PopMenuItem;->stylePressed:Lrexsee/core/style/StyleSheet;

    iget-object v10, v10, Lrexsee/core/style/StyleSheet;->styleText:Ljava/lang/String;

    invoke-virtual {v9, v10}, Lrexsee/core/style/StyleSheet;->parseStyle(Ljava/lang/String;)Lrexsee/core/style/StyleSheet;

    .line 91
    invoke-virtual {v7, v13}, Lrexsee/core/widget/Tab;->setSelected(Z)V

    .line 80
    add-int/lit8 v4, v4, 0x1

    goto/16 :goto_0

    .line 124
    .end local v1    # "bar":Lrexsee/core/widget/TabBar;
    .end local v2    # "contextStyle":Ljava/lang/String;
    .end local v3    # "dialog":Landroid/app/AlertDialog;
    .end local v4    # "i":I
    .end local v5    # "item":Lrexsee/core/menu/PopMenuItem;
    .end local v7    # "tab":Lrexsee/core/widget/Tab;
    :cond_2
    new-instance v3, Lrexsee/core/widget/DivDialog;

    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->val$browser:Lrexsee/core/browser/Browser;

    const/4 v10, 0x0

    iget-object v11, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    iget-object v11, v11, Lrexsee/core/menu/PopMenu;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v11, v11, Lrexsee/core/style/StyleSheet;->styleText:Ljava/lang/String;

    invoke-direct {v3, v9, v10, v11}, Lrexsee/core/widget/DivDialog;-><init>(Lrexsee/core/browser/Browser;Ljava/lang/String;Ljava/lang/String;)V

    .line 125
    .local v3, "dialog":Lrexsee/core/widget/DivDialog;
    new-instance v9, Lrexsee/core/menu/PopMenu$1$5;

    invoke-direct {v9, p0}, Lrexsee/core/menu/PopMenu$1$5;-><init>(Lrexsee/core/menu/PopMenu$1;)V

    invoke-virtual {v3, v9}, Lrexsee/core/widget/DivDialog;->setOnCancelListener(Landroid/content/DialogInterface$OnCancelListener;)V

    .line 134
    new-instance v9, Lrexsee/core/menu/PopMenu$1$6;

    invoke-direct {v9, p0}, Lrexsee/core/menu/PopMenu$1$6;-><init>(Lrexsee/core/menu/PopMenu$1;)V

    invoke-virtual {v3, v9}, Lrexsee/core/widget/DivDialog;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V

    .line 143
    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    iget-object v9, v9, Lrexsee/core/menu/PopMenu;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v9, v9, Lrexsee/core/style/StyleSheet;->window_cancelable:Ljava/lang/String;

    const-string v10, "true"

    invoke-virtual {v9, v14}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v9

    if-eqz v9, :cond_3

    .line 144
    new-instance v9, Lrexsee/core/menu/PopMenu$1$7;

    iget-object v10, p0, Lrexsee/core/menu/PopMenu$1;->val$browser:Lrexsee/core/browser/Browser;

    invoke-direct {v9, p0, v10}, Lrexsee/core/menu/PopMenu$1$7;-><init>(Lrexsee/core/menu/PopMenu$1;Lrexsee/core/browser/Browser;)V

    invoke-virtual {v3, v9}, Lrexsee/core/widget/DivDialog;->setOnKeyListener(Landroid/content/DialogInterface$OnKeyListener;)V

    .line 160
    :cond_3
    new-instance v1, Lrexsee/core/widget/TabBar;

    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->val$context:Landroid/content/Context;

    iget-object v10, p0, Lrexsee/core/menu/PopMenu$1;->val$mThis:Lrexsee/core/menu/PopMenu;

    invoke-direct {v1, v9, v10}, Lrexsee/core/widget/TabBar;-><init>(Landroid/content/Context;Lrexsee/core/menu/PopMenu;)V

    .line 161
    .restart local v1    # "bar":Lrexsee/core/widget/TabBar;
    const/4 v4, 0x0

    .restart local v4    # "i":I
    :goto_2
    iget-object v9, v1, Lrexsee/core/widget/TabBar;->mContainer:Landroid/widget/LinearLayout;

    invoke-virtual {v9}, Landroid/widget/LinearLayout;->getChildCount()I

    move-result v9

    if-lt v4, v9, :cond_6

    .line 171
    invoke-virtual {v3, v1}, Lrexsee/core/widget/DivDialog;->addChild(Landroid/view/View;)V

    .line 172
    invoke-virtual {v3}, Lrexsee/core/widget/DivDialog;->start()V

    .line 173
    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    iget-object v9, v9, Lrexsee/core/menu/PopMenu;->dynamicLocation:Lrexsee/core/menu/PopMenu$DynamicLocation;

    if-eqz v9, :cond_0

    .line 174
    invoke-virtual {v3}, Lrexsee/core/widget/DivDialog;->getWindow()Landroid/view/Window;

    move-result-object v8

    .line 175
    .local v8, "window":Landroid/view/Window;
    invoke-virtual {v8}, Landroid/view/Window;->getAttributes()Landroid/view/WindowManager$LayoutParams;

    move-result-object v0

    .line 176
    .local v0, "attr":Landroid/view/WindowManager$LayoutParams;
    const/16 v9, 0x33

    iput v9, v0, Landroid/view/WindowManager$LayoutParams;->gravity:I

    .line 177
    iget-object v9, p0, Lrexsee/core/menu/PopMenu$1;->this$0:Lrexsee/core/menu/PopMenu;

    iget-object v9, v9, Lrexsee/core/menu/PopMenu;->dynamicLocation:Lrexsee/core/menu/PopMenu$DynamicLocation;

    invoke-virtual {v9}, Lrexsee/core/menu/PopMenu$DynamicLocation;->run()[I

    move-result-object v6

    .line 178
    .local v6, "location":[I
    aget v9, v6, v13

    if-ltz v9, :cond_4

    aget v9, v6, v13

    iput v9, v0, Landroid/view/WindowManager$LayoutParams;->x:I

    .line 179
    :cond_4
    aget v9, v6, v12

    if-ltz v9, :cond_5

    aget v9, v6, v12

    iput v9, v0, Landroid/view/WindowManager$LayoutParams;->y:I

    .line 180
    :cond_5
    invoke-virtual {v8, v0}, Landroid/view/Window;->setAttributes(Landroid/view/WindowManager$LayoutParams;)V

    goto/16 :goto_1

    .line 162
    .end local v0    # "attr":Landroid/view/WindowManager$LayoutParams;
    .end local v6    # "location":[I
    .end local v8    # "window":Landroid/view/Window;
    :cond_6
    iget-object v9, v1, Lrexsee/core/widget/TabBar;->mContainer:Landroid/widget/LinearLayout;

    invoke-virtual {v9, v4}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v7

    check-cast v7, Lrexsee/core/widget/Tab;

    .line 163
    .restart local v7    # "tab":Lrexsee/core/widget/Tab;
    new-instance v9, Lrexsee/core/menu/PopMenu$1$8;

    invoke-direct {v9, p0, v3}, Lrexsee/core/menu/PopMenu$1$8;-><init>(Lrexsee/core/menu/PopMenu$1;Lrexsee/core/widget/DivDialog;)V

    iput-object v9, v7, Lrexsee/core/widget/Tab;->extraRunnable:Ljava/lang/Runnable;

    .line 169
    invoke-virtual {v7, v13}, Lrexsee/core/widget/Tab;->setSelected(Z)V

    .line 161
    add-int/lit8 v4, v4, 0x1

    goto :goto_2
.end method
